(
	function () {
		var crypto, digest;

		crypto = require("crypto");

		digest = crypto.Hash.prototype.digest;

		crypto.Hash.prototype.digest =
			function (base) {
				if (base === "urlbase64") {
					return digest
						.call(this, "base64")
						.replace(/\+/g, "-")
						.replace(/\//g, "_")
						.replace(/=+$/, "");
				}
				return digest.apply(this, arguments);
			};
	}.call(this)
);
